package UserUI;

import loginUI.LoginFrame;
import frameUI.ShowFrame;
import userManageUI.CancelAccountFrame;
import userManageUI.ChangePassWordFrame;
import userManageUI.RegisterAccountFrame;
import userManageUI.StudentInfoFrame;
import userManageUI.TeacherInfoFrame;
import VO.UserVO;

public class AdminController {
	private static UserVO userVO;
	private static AdminFrame adminFrame;
	private static RegisterAccountFrame registerAccountFrame;
	private static CancelAccountFrame cancelAccountFrame;
	private static StudentInfoFrame studentInfoFrame;
	private static TeacherInfoFrame teacherInfoFrame;
	private static ChangePassWordFrame changePassWordFrame;
	//private static ShowFrame showFrame;
	public AdminController(UserVO userVO){
		this.userVO = userVO;
		adminFrame = new AdminFrame(this.userVO);
		registerAccountFrame = new RegisterAccountFrame(this.userVO);
	    cancelAccountFrame = new CancelAccountFrame(this.userVO) ;
	    studentInfoFrame = new StudentInfoFrame(this.userVO,false);
		teacherInfoFrame = new TeacherInfoFrame(this.userVO,false);
		changePassWordFrame = new ChangePassWordFrame(this.userVO);
		//showFrame = new ShowFrame(userVO, false, null) ;
	}
	public AdminController(){
		
	}
	
	public static void jumpTo(String frame){
		switch(frame){
		case"login":
			new LoginFrame().setVisible(true);break;
		case"main":
			adminFrame.setVisible(true);break;
		case"registerAccountFrame":
			registerAccountFrame.setVisible(true);break;
		case"cancelAccountFrame":
			cancelAccountFrame.setVisible(true);break;
		case"studentInfoFrame":
			studentInfoFrame.setVisible(true);break;
		case"teacherInfoFrame":
			teacherInfoFrame.setVisible(true);break;
		case"changePassWordFrame":
			changePassWordFrame.setVisible(true);break;
		
		}
	}
}
